package com.aaa.demo03;

/**
 * @author 荆豪峰
 * @version 1.0
 */
public class Test03 {
    public static void main(String[] args) {
        Info<String> info = new Info<>();
        info.setB("1");
        fun(info);
        Info<Number> info2 = new Info<>();
        info2.setB(222);
        fun1(info2);
        Info<Object> info3 = new Info<>();
        fun1(info3);
    }
    public static void fun(Info <? extends String> info){
        info.show();
    }
    public static void fun1(Info<? super Number> info){
        info.show();
    }
}

class Info<T>{
    private T b;

    public void show(){
        System.out.println("这也是一句话");
    }

    public T getB() {
        return b;
    }

    public void setB(T b) {
        this.b = b;
    }
}
